<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;

class CreatePowerLogTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('power_log', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->integer('user_id')->comment('用户id');
            $table->integer('type')->comment('算力类型');
            $table->decimal('power','8','0')->comment('变更算力');
            $table->tinyInteger('status')->comment('状态1增加2减少');
            $table->string('comment')->default('')->comment('备注');
            // $table->integer('rent_id')->default('0')->comment('=rentCloth.id');
            $table->timestamps();
        });

        DB::statement("ALTER TABLE `power_log` comment '算力变更记录';");

    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('power_log');
    }
}
